package com.auto.survey.activity.adjustment.adjustment_high.entity

import androidx.room.Entity
import androidx.room.ForeignKey
import androidx.room.Index
import androidx.room.PrimaryKey

//测段观测值
@Entity(
    tableName = "observations",
    foreignKeys = [
        ForeignKey(
            entity = Project::class,
            parentColumns = ["id"],
            childColumns = ["projectId"],
            onDelete = ForeignKey.CASCADE
        )
    ],
    indices = [Index("projectId")]
)
data class Observation(
    @PrimaryKey(autoGenerate = true)
    var id: Int = 0,
    val projectId: Int,
    val startPoint: String, // 起点名
    val endPoint: String, // 终点名
    val heightDiff: Double, // 观测高差(m)
    val distance: Double, // 距离(km)
    var adjustedHeightDiff: Double? = null, // 平差后高差(m)
    var correction: Double? = null, // 改正数(mm)
    var stdDev: Double? = null // 高差中误差(mm)
)